import request from '@/utils/axios'

export type SmsChannelType = {
  id: number
  code: string
  status: number
  signature: string
  remark: string
  apiKey: string
  apiSecret: string
  callbackUrl: string
}

export interface SmsChannelPageReqType extends PageParam {
  signature?: string
  status?: number
  create_time?: Date[]
}

/**
 * 消息中心 - 短信管理 - 短信渠道接口
 */
export const SmsChannelApi = {
  // 新增
  create: (data: SmsChannelType) => {
    return request.post({ url: '/system/sms-channel/create', data, is_mock: true })
  },
  // 修改
  update: (data: SmsChannelType) => {
    return request.put({ url: '/system/sms-channel/update', data, is_mock: true })
  },
  // 删除
  delete: (id: number) => {
    return request.delete({ url: '/system/sms-channel/delete?id=' + id, is_mock: true })
  },
  // 查询详情
  detail: (id: number) => {
    return request.get({ url: '/system/sms-channel/detail?id=' + id, is_mock: true })
  },
  // 查询分页列表
  page: (params: SmsChannelPageReqType) => {
    return request.get({ url: '/system/sms-channel/page', params, is_mock: true })
  },
  // 查询精简列表
  simple: () => {
    return request.get({ url: '/system/sms-channel/simple-list', is_mock: true })
  }
}
